package com.ghca.mystudy.loadbalance;

import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.rpc.Invocation;
import com.alibaba.dubbo.rpc.Invoker;
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
import com.alibaba.dubbo.rpc.cluster.loadbalance.RandomLoadBalance;

import java.util.List;

/**
 * Created by gh on 2016/11/18.
 */
public class TestLoadBalance extends RandomLoadBalance {
    @Override
    protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
        System.out.println("url:"+url);
        System.out.println("invocation:"+invocation.getInvoker());
        invokers.forEach((invoker)-> System.out.println(invoker));
        return super.doSelect(invokers, url, invocation);
    }
}
